import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';
import {${cfg.name}Res, ${cfg.name}Req} from './${cfg.name}.model';

@Injectable({
  providedIn: 'root'
})
export class ${cfg.name}Service {
  constructor(private http: HttpClient) {
  }

  public get(id): Observable<${cfg.name}Res> {
    return this.http.get<${cfg.name}Res>('' + '?id=' + id);
  }

  public put(data: ${cfg.name}Req): Observable<${cfg.name}Res> {
    return this.http.put<${cfg.name}Res>('', data);
  }

  public post(data: ${cfg.name}Req): Observable<${cfg.name}Res> {
    return this.http.post<${cfg.name}Res>('', data);
  }


  public delete(id): Observable<${cfg.name}Res> {
    return this.http.delete<${cfg.name}Res>('');
  }
}
